package com.kunpu.mami.channel.common;

/**
 * Created with IntelliJ IDEA.
 * User: liuhao
 */
public enum ResConstants {
    // 1000-1030 为系统公共异常
    SUCCESS(200, "成功"),
    PARAM_NOT_RIGHT(1001, "入参数值不合法"),
    PARAM_NOT_NULL(1002, "必要参数不能为空"),
    QUERY_DATA_EXCEPTION(1003, "查询数据异常"),
    QUERY_DATA_EXIST(1004, "查询数据存在"),
    QUERY_DATA_NOT_EXIST(1005, "查询数据不存在"),
    ADD_DATA_FAIL(1006, "添加数据失败"),
    UPD_DATA_FAIL(1007, "更新数据失败"),
    DEL_DATA_FAIL(1008, "删除数据失败"),
    OBJECT_NOT_NULL(1009, "入参对象不能为空"),
    INTERFACE_ACCESS_EXCEPTION(1010, "接口调用获取异常"),

    // 1130-1140  为http对外请求异常
    HTTPS_REQUEST_EXCEPTION(1130, "https请求异常"),
    HTTPS_COMMUNICATION_FAIL(1131,"https网络通讯失败"),
    HTTPS_REQUERT_FAIL(1132 , "https请求处理结果失败"),

    // 1501-1510 为登陆记录异常
    USERNAME_NON_EXISTENT(1501, "用户名不存在"),
    PASSWORD_FAIL_EXCEPTION(1502, "登陆密码不正确"),

    // 1510-1520 为登陆记录异常
    PAY_ANALYSIS_EXISTENT(1510, "调用支付解析异常"),
    PAY_RESULT_EXCEPTION(1511, "调用支付返回结果异常"),
    PAY_FROZEN_AMOUNT_EXCEPTION(1512,"账户冻结异常"),    
    PAY_RESULT_SENDMSG_EXCEPTION(1513, "短信验证码错误或失效"),
    PAY_RESULT_BALANCE_EXCEPTION(1514, "账户余额不足"),

    


    PAY_CASH_BIG100_EXCEPTION(1520 , "余额大与100时,提现额度必须大与100"),
    PAY_CASH_SMALL100_EXCEPTION(1521 , "余额小与100时,取光"),
    PAY_CASH_TIMES_EXCEPTION(1522 , "提现次数大于限定次数"),
    PAY_CASH_AMOUNT_EXCEPTION(1523,"可用额度小于提现额度"),
    PAY_CASH_EXCEPTION(1524,"提现异常"),
    PAY_CASH_SMALL_FREE_EXCEPTION(1525,"剩余金额小于提现手续费"),

    // 1531-1630 为注册记录异常
    ADD_REGINFO_EXCEPTION(1531, "记录注册来路异常"),
    DIGITAL_SIGN_EXCEPTION(1532, "数字签名访问异常"),
    SMS_SEND_EXCEPTION(1533, "短信发送异常"),
    SMS_TIME_EXCEPTION(1534, "短信发送时间异常"),
    SMS_AUTHCODE_EXCEPTION(1535, "短信验证码不正确"),
    SMS_SERNTIME_EXCEPTION(1536, "短信发送时间间隔太小，涉嫌恶意操作"),
    SMS_SERNUM_EXCEPTION(1537, "短信发送次数异常，次数超过合法阈值，涉嫌恶意操作"),
    USERNAME_ALREADY_EXIST_EXCEPTION(1538, "用户已注册"),

    // 1631-1640 为缓存异常
    PUT_DATA_CACHE_EXCEPTION(1631, "将数据放到缓存中异常"),
    GET_DATA_CACHE_EXCEPTION(1632, "根据KEY获取数据异常"),

    // 1641-1670 为MQ异常
    SEND_MQ_EXCEPTION(1641, "发送MQ消息异常"),
    INIT_MQ_EXCEPTION(1642, "发送MQ消息异常"),

    //1651-1660
    AINONG_ANALYSIS_EXCEPTION(1651 ,"爱弄支付解析异常"),
    AINONG_RESULT_EXCEPTION(1652 ,"爱弄回调解析异常"),
    AINONG_SEND_EXCEPTION(1653 ,"爱弄短信发送异常"),
    AINONG_ORDER_EXCEPTION(1654 ,"爱弄下单异常"),
    AINONG_PAY_EXCEPTION(1655 ,"爱弄支付异常"),
    AINONG_VAILD_EXCEPTION(1656 ,"爱弄验证异常"),
    AINONG_RETURN_EXCEPTION(1657 ,"爱弄返回值异常"),

    //1670-1690 为正则验证异常
    MOBLIE_FORMAT_EXCEPTION(1671,"手机号码格式不正确"), ;



    private final int code; // 错误码

    private final String msg; // 错误描述

    private ResConstants(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public String getMsg(String desc) {
        return msg + ":" + desc;
    }
}